package com.lalilu.lmusic

import android.Manifest
import android.os.Build

object Config {
    const val LRCSHARE_BASEURL = "https://api.lrcshare.com"

    const val LAST_PLAYED_ID = "LAST_PLAYED_ID"
    const val LAST_PLAYED_LIST_IDS = "LAST_PLAYED_LIST_IDS"
    const val LAST_PLAYED_POSITION = "LAST_PLAYED_POSITION"

    const val ACTION_SET_REPEAT_MODE = "action_set_repeat_mode"

    // 计入历史记录的播放时长阈值
    const val HISTORY_DURATION_THRESHOLD = 1000 * 5

    const val KEY_REMEMBER_IS_GUIDING_OVER = "KEY_REMEMBER_IS_GUIDING_OVER"
    const val KEY_SETTINGS_BLOCKED_PATHS = "KEY_SETTINGS_BLOCKED_PATHS"
    const val KEY_SETTINGS_IS_ENABLE_BLUR_EFFECT = "KEY_SETTINGS_IS_ENABLE_BLUR_EFFECT"
    const val KEY_SETTINGS_IS_DRAW_TRANSLATION = "KEY_SETTINGS_IS_DRAW_TRANSLATION"
    const val KEY_SETTINGS_DURATION_FILTER = "KEY_SETTINGS_DURATION_FILTER"
    const val KEY_SETTINGS_DARK_MODE_OPTION = "KEY_SETTINGS_DARK_MODE_OPTION"
    const val KEY_SETTINGS_ENABLE_UNKNOWN_FILTER = "KEY_SETTINGS_ENABLE_UNKNOWN_FILTER"
    const val KEY_SETTINGS_LYRIC_GRAVITY = "KEY_SETTINGS_LYRIC_GRAVITY"
    const val KEY_SETTINGS_LYRIC_TEXT_SIZE = "KEY_SETTINGS_LYRIC_TEXT_SIZE"
    const val KEY_SETTINGS_STATUS_LYRIC_ENABLE = "KEY_SETTINGS_STATUS_LYRIC_ENABLE"
    const val KEY_SETTINGS_IGNORE_AUDIO_FOCUS = "KEY_SETTINGS_IGNORE_AUDIO_FOCUS"
    const val KEY_SETTINGS_VOLUME_CONTROL = "KEY_SETTINGS_VOLUME_CONTROL"
    const val KEY_SETTINGS_LYRIC_TYPEFACE_PATH = "KEY_SETTINGS_LYRIC_TYPEFACE_PATH"
    const val KEY_SETTINGS_ENABLE_SYSTEM_EQ = "KEY_SETTINGS_ENABLE_SYSTEM_EQ"
    const val KEY_SETTINGS_PLAY_MODE = "KEY_SETTINGS_PLAY_MODE"
    const val KEY_SETTINGS_ENABLE_DYNAMIC_TIPS = "KEY_SETTINGS_ENABLE_DYNAMIC_TIPS"
    const val KEY_SETTINGS_AUTO_HIDE_SEEKBAR = "KEY_SETTINGS_AUTO_HIDE_SEEKBAR"
    const val KEY_SETTINGS_FORCE_HIDE_STATUS_BAR = "KEY_SETTINGS_FORCE_HIDE_STATUS_BAR"
    const val KEY_SETTINGS_KEEP_SCREEN_ON_WHEN_LYRIC_EXPANDED =
        "KEY_SETTINGS_KEEP_SCREEN_ON_WHEN_LYRIC_EXPANDED"

    const val DEFAULT_SETTINGS_IS_ENABLE_BLUR_EFFECT = true
    const val DEFAULT_SETTINGS_IS_DRAW_TRANSLATION = true
    const val DEFAULT_SETTINGS_DURATION_FILTER = 15
    const val DEFAULT_SETTINGS_DARK_MODE_OPTION = 0
    const val DEFAULT_SETTINGS_ENABLE_UNKNOWN_FILTER = true
    const val DEFAULT_SETTINGS_LYRIC_GRAVITY = 1
    const val DEFAULT_SETTINGS_LYRIC_TEXT_SIZE = 16
    const val DEFAULT_SETTINGS_STATUS_LYRIC_ENABLE = false
    const val DEFAULT_SETTINGS_IGNORE_AUDIO_FOCUS = false
    const val DEFAULT_SETTINGS_VOLUME_CONTROL = 100
    const val DEFAULT_SETTINGS_LYRIC_TYPEFACE_PATH = ""
    const val DEFAULT_SETTINGS_ENABLE_SYSTEM_EQ = false
    const val DEFAULT_SETTINGS_PLAY_MODE = 0
    const val DEFAULT_SETTINGS_ENABLE_DYNAMIC_TIPS = true
    const val DEFAULT_SETTINGS_AUTO_HIDE_SEEKBAR = false
    const val DEFAULT_SETTINGS_FORCE_HIDE_STATUS_BAR = false
    const val DEFAULT_SETTINGS_KEEP_SCREEN_ON_WHEN_LYRIC_EXPANDED = false

    val REQUIRE_PERMISSIONS = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
        Manifest.permission.READ_MEDIA_AUDIO
    } else {
        Manifest.permission.READ_EXTERNAL_STORAGE
    }
}